{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "5d3dca5a",
   "metadata": {},
   "source": [
    "## 题目一\n",
    "\n",
    "有一个这样的DNA核酸序列\n",
    "\n",
    "“AGCTTTTCATTCTGACTGCAACGGGCAATATGTCTCTGTGTGGATTAAAAAAAGAGTGTCTGATAGCAGC”\n",
    "\n",
    "请把这个核酸序列存入一个list，并数一数A、G、C、T各有多少个。"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "id": "e6521351",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "{'A': 20, 'G': 17, 'C': 12, 'T': 21}\n"
     ]
    }
   ],
   "source": [
    "# 你的代码\n",
    "dna_str = \"AGCTTTTCATTCTGACTGCAACGGGCAATATGTCTCTGTGTGGATTAAAAAAAGAGTGTCTGATAGCAGC\"\n",
    "dna_list = list(dna_str)\n",
    "record = {}\n",
    "for i in dna_list:\n",
    "  if dna_list.count(i)>1:\n",
    "    record[i] = dna_list.count(i)\n",
    "print (record)"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "daf8500d",
   "metadata": {},
   "source": [
    "## 题目二\n",
    "\n",
    "一个花样滑冰运动员表演后，裁判给表演内容进行评分，分数从0.25分到10分，每次增加值为0.25分。\n",
    "\n",
    "试生成一个元组，把可能的得分存入元组，并遍历元组的每一项，打印“一个运动员可能得_____分”。"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "id": "90604ebb",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "一个运动员可能得0.25分\n",
      "一个运动员可能得0.5分\n",
      "一个运动员可能得0.75分\n",
      "一个运动员可能得1.0分\n",
      "一个运动员可能得1.25分\n",
      "一个运动员可能得1.5分\n",
      "一个运动员可能得1.75分\n",
      "一个运动员可能得2.0分\n",
      "一个运动员可能得2.25分\n",
      "一个运动员可能得2.5分\n",
      "一个运动员可能得2.75分\n",
      "一个运动员可能得3.0分\n",
      "一个运动员可能得3.25分\n",
      "一个运动员可能得3.5分\n",
      "一个运动员可能得3.75分\n",
      "一个运动员可能得4.0分\n",
      "一个运动员可能得4.25分\n",
      "一个运动员可能得4.5分\n",
      "一个运动员可能得4.75分\n",
      "一个运动员可能得5.0分\n",
      "一个运动员可能得5.25分\n",
      "一个运动员可能得5.5分\n",
      "一个运动员可能得5.75分\n",
      "一个运动员可能得6.0分\n",
      "一个运动员可能得6.25分\n",
      "一个运动员可能得6.5分\n",
      "一个运动员可能得6.75分\n",
      "一个运动员可能得7.0分\n",
      "一个运动员可能得7.25分\n",
      "一个运动员可能得7.5分\n",
      "一个运动员可能得7.75分\n",
      "一个运动员可能得8.0分\n",
      "一个运动员可能得8.25分\n",
      "一个运动员可能得8.5分\n",
      "一个运动员可能得8.75分\n",
      "一个运动员可能得9.0分\n",
      "一个运动员可能得9.25分\n",
      "一个运动员可能得9.5分\n",
      "一个运动员可能得9.75分\n",
      "一个运动员可能得10.0分\n"
     ]
    }
   ],
   "source": [
    "# 你的代码\n",
    "score = ()\n",
    "i=0.25\n",
    "while i<=10:\n",
    "    score=score+(i,)\n",
    "    print('一个运动员可能得%s分'% i)\n",
    "    i=i+0.25"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "0c3a4e99",
   "metadata": {},
   "source": [
    "## 题目三\n",
    "\n",
    "创建一个字典，列出你所了解的地域美食，比如{'肠粉':{'城市':'广州','原料':'米'}}。当然，你可以做的更丰富一些。\n",
    "最后遍历你熟悉的美食，打印出，类似如下的句子：“肠粉是广州的一种美食，它的主要原料是米”。"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "id": "b0026af6",
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\n",
      " 肠粉是广州的一种美食，它的主要原料是米\n",
      "\n",
      " 锅塌里脊是天津的一种美食，它的主要原料是里脊肉\n",
      "\n",
      " 烧饼是登封的一种美食，它的主要原料是天然小麦\n"
     ]
    }
   ],
   "source": [
    "# 你的代码\n",
    "foods={'肠粉':{'城市':'广州','原料':'米'},'锅塌里脊':{'城市':'天津','原料':'里脊肉'},'烧饼':{'城市':'登封','原料':'天然小麦'}}\n",
    "for food, infor in foods.items():\n",
    "    print('\\n %s是%s的一种美食，它的主要原料是%s' % (food, infor['城市'], infor['原料'] ))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "d11583fa",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.0"
  },
  "toc": {
   "base_numbering": 1,
   "nav_menu": {},
   "number_sections": false,
   "sideBar": true,
   "skip_h1_title": false,
   "title_cell": "Table of Contents",
   "title_sidebar": "Contents",
   "toc_cell": false,
   "toc_position": {},
   "toc_section_display": true,
   "toc_window_display": false
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
